﻿Public Class CongratsMsg

    Dim Counter As Integer = 0

    Private Sub CongratsMsg_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Pause(False)
        FoodName.Left = (Me.Width - FoodName.Width) / 2
        IconImage.Left = (Me.Width - IconImage.Width) / 2
    End Sub

    Public Sub Pause(ByVal status As Boolean)
        Timer1.Enabled = Not status
    End Sub

    Public Sub ShowByType(ByVal type As Integer)
        Dim food As String = ""
        Select Case type
            Case 0
                food = "Good"
            Case 1
                food = "Best"
        End Select

        IconImage.Image = ImageList1.Images(type)
        FoodName.Text = food

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Counter += 1

        Me.Top -= 1

        If (Counter >= 30) Then
            Me.Dispose()
        End If

    End Sub
End Class